package com.oocl.sc.service.impl;

import com.oocl.sc.dao.SuserDao;
import com.oocl.sc.dao.impl.SuserDaoImpl;
import com.oocl.sc.entity.Suser;
import com.oocl.sc.service.SuserService;

public class SuserServiceImpl implements SuserService{
	
	private SuserDao suserDao = new SuserDaoImpl();

	public Suser login(String account, String password) {
		return suserDao.login(account, password);
	}

	public int register(String account, String password) {
		int m = suserDao.isExisted(account);
		if (m != 1) {
			suserDao.add(account, password);
			return 1;
		}else{
			return 0;
		}
		
	}

}
